//
//  EarningsModel.swift
//  LeTu
//
//  Created by g1 on 2023/12/30.
//

import Foundation

class EarningsRecordModel: Mappable {
    
    var balance = 0
    var createTime = ""
    var description = ""
    var englishDescription = ""
    var id = 0
    var incomeLevel = 0
    var incomeMoney = 0.0
    var incomeType = 0
    var nickname = ""
    var orderId = 0
    var subLevelUserId = 0
    var subLevelUserMobile = ""
    var updateTime = ""
    var userId = 0
    var userMobile = ""
    /// 0:未转账 1:已转账 2:已拒绝
    var withdrawStatus = 0
    var withdrawStatusText: String {
        switch withdrawStatus {
        case 0:
            return "处理中".localized
        case 2:
            return LanguageManager.shared.currentLanguage == .zh ? rejectionReason:rejectionReasonEnglish
        default:
            return ""
        }
    }
    var rejectionReason = ""
    var rejectionReasonEnglish = ""

    
    init() {
        
    }
    
    required init?(map: ObjectMapper.Map) {
        
        balance <- map["balance"]
        createTime <- map["createTime"]
        description <- map["description"]
        englishDescription <- map["englishDescription"]
        id <- map["id"]
        incomeLevel <- map["incomeLevel"]
        incomeMoney <- map["incomeMoney"]
        incomeType <- map["incomeType"]
        nickname <- map["nickname"]
        orderId <- map["orderId"]
        subLevelUserId <- map["subLevelUserId"]
        subLevelUserMobile <- map["subLevelUserMobile"]
        updateTime <- map["updateTime"]
        userId <- map["userId"]
        userMobile <- map["userMobile"]
        withdrawStatus <- map["withdrawStatus"]
        rejectionReason <- map["rejectionReason"]
        rejectionReasonEnglish <- map["rejectionReasonEnglish"]
        
    }
    
    func mapping(map: ObjectMapper.Map) {
        
    }
    
}
